#!/usr/bin/perl
use strict;
use warnings;

my %food_color = (
               "Apple"  => "red",
               "Banana" => "yellow",
               "Lemon"  => "yellow",
               "Carrot" => "orange"
              );
sub print_foods {
  my @foods = keys %food_color;
  my $food;

  print "Keys: @foods\n";
  print "Values: ";

  foreach $food (@foods) {
    my $color = $food_color{$food};

    if (defined $color) {
      print "$color ";
    } else {
      print "(undef) ";
    }
  }
  print "\n";
}
print "Initially: \n";
print_foods();

print"\nWith Banana undef\n";
undef $food_color{"Banana"};
print_foods();

print "\n With Banana deleted\n";
delete $food_color{"Banana"};
print_foods();
